/*******************************************************************************
* 
* RiffReader parse RIFF (WAVE) file
* 
* 
******************************************************************************/
#pragma once
#include "noria.h"
#include <windows.h>

using std::istream;

namespace noria{ namespace xaudio
{

    class RiffReader
    {
    public:
        RiffReader(void);
        ~RiffReader(void);

        bool parse(const wstring& source);
        bool parse(istream& source);
        bool parse(cbinary_ref source);

        const WAVEFORMATEX* wavefmt() const;
        size_t size() const;
        cbyte_ptr offset() const;

    private:
        WAVEFORMATEX m_fmt;
        size_t m_size;
        byte_ptr m_offset;
    };

}}